<template>
  <div>
    <div id="mainScroll">
      <!-- 专题详情 -->
      <div class="subject-content hairline-top hairline-bottom">
        <div class="subject-pic-box">
          <img :src="subData.subjectContent.picUrl" class="subject-pic" alt=""/>
        </div>
        <div class="subject-detail pre-wrap" v-html="subData.subjectContent.detailContent">
        </div>
      </div>

      <!-- 选项卡  最美北京  问题处理 -->
      <div class="subject-list hairline-top">
        <div class="list-title">
          <span>看看大家的专题随手拍</span>
        </div>
        <div class="waterfalls" id="wf">
          <!-- 无数据的时候 点击跳转发起随手拍 -->
          <div class="com-errorPage" v-if="subData.photos && subData.photos.length==0 && subData.showData">
            <p class="erroricon">
              <i class="icon icon-nodata"></i>
            </p>
            <p class="errormsg">暂无数据</p>
          </div>

          <!-- 专题随手拍列表  start-->
          <div v-if="subData.photos && subData.photos.length>0">
            <div v-for="(item , index) in subData.photos" class="photo-container" :class="{'load':item.load}" :key="index">
              <div class="img-box" @click="godetail(item.convId,index,item.convType)">
                <img :src="item.photo" @load="arrange(index)">
                <i class="img-num-box" v-text="item.photos"></i>
              </div>
              <div class="subinfo-box">
                <div class="title" @click="godetail(item.convId,index,item.convType)"><a class="subject-link"
                                                                                   @click.stop="goSubject()">{{subData.subjectName}}</a>{{item.content
                  | subStrings(subData.subjectName)}}
                </div>
                <div class="act-box" v-if="item.convType != 2">
              <span class="vote-box" :class="{'active': item.praised}" @click="praise(item)">
                <i :class="{'vote-icon': true}"></i>
                <i class="vote-num">{{item.praiseCount | changeVote}}</i>
              </span>

                  <span class="discuzz-box" @click="godetail(item.convId,index,item.convType)">
                <i class="discuzz"></i>
                <i class="discuzz-num">{{item.commentCount | changeDis}}</i>
              </span>
                </div>
              </div>
            </div>
          </div>
          <!-- 专题随手拍列表  end -->
          <!-- 加载更多 -->
          <div id="mainScrolldroploadDOM" class="droploadDOM"></div>
        </div>
      </div>


    </div>
    <!--添加悬浮按钮-->
    <!--<div class="float-button" v-if="subjectContent.isShelve =='1'">-->
      <!--<div class="action-box">-->
        <div class="pack-nav" :class="subData.showActionFlag " v-if="subData.subjectContent.isShelve =='1'">
          <div class="nav-icon" @click="showAction()">
            <i class="add-icon"></i>
            <p class="add-title">发布</p>
          </div>
          <div class="nav-action">
            <!--<div class="list-1">-->
            <div class="action-item" @click="goPhoto">
              <div class="icon-publish"></div>
              <div class="action-text">
                <div class="icon-title">发布</div>
              </div>
              <!--</div>-->
            </div>
            <!--<div class="list-2">-->
            <div class="action-item action-mypub" @click="goMyPhoto">
              <div class="icon-publish icon-my-pub">
                <i class="comment-dot" v-if="subData.hasComment"></i>
              </div>
              <div class="action-text-mypub">
                <div class="icon-title">我的</div>
              </div>
            </div>
            <!--</div>-->
          </div>
        </div>
      <!--</div>-->
    <!--</div>-->
  </div>
</template>

<script>
  import index from './list';
  export default index;
</script>


<style lang="less" scoped>
  .droploadDOM{ position: absolute ; width: 100% ; top: 0 ; }
  /*专题详情*/
  .subject-detail {
    font-size: 15px;
    color: #222;
    line-height: 23px;
    padding: 15px;
    margin-bottom: 10px;
    background: #fff;
  }

  .subject-pic-box {
    height: 190px;
  }

  img.subject-pic {
    height: 100%;
  }

  /*列表*/
  .list-title {
    font-size: 16px;
    line-height: 24px;
    color: #222;
    letter-spacing: 0;
    padding: 14px 15px;
    font-weight: bold;
    background: #fff;
  }

  /*暂无数据*/
  .subject-list .com-errorPage {
    padding-top: 0;
  }

  .subject-list .com-errorPage p i {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    margin-top: 40px;
  }

  /*专题*/
  a.subject-link {
    color: #12418E;
  }

  #wf {
    padding-bottom: 10px;
  }

  .load {
    position: relative;
    top: 90px;
  }

  #more {
    position: absolute;
    width: 100%;
    top: 100%;
    z-index: -1;
    /*display: none;*/
    /*background: red;*/
  }

  .droploadDOM {
    height: 30px;
    /*background: yellow;*/
  }

  /*  操作框  */
  .float-button {
    position: fixed;
    right: 35px;
    bottom: 65px;
    height: 65px;
  }

  .add-icon-box {
    width: 65px;
    height: 65px;
    background: red;
    border: 1px solid red;
    border-radius: 50%;
    position: relative;
    float: right;
  }

  .add-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url("../img/icon-add.png") no-repeat;
    background-size: contain;
    position: absolute;
    top: 11px;
    left: 22px;
  }

  .add-title {
    position: absolute;
    bottom: 8px;
    left: 18px;
    font-size: 13px;
    color: #fff;
  }

  @keyframes scope0 {
    0% {
      width: 64px;
    }
    100% {
      width: 192px;
    }
  }

  @-webkit-keyframes scope0 /* Safari 和 Chrome */
  {
    0% {
      width: 64px;
    }
    100% {
      width: 192px;
    }
  }

  @keyframes scope1 {
    0% {
      width: 192px;
    }
    100% {
      width: 64px;
    }
  }

  @-webkit-keyframes scope1 /* Safari 和 Chrome */
  {
    0% {
      width: 192px;
    }
    100% {
      width: 64px;
    }
  }

  .pack-nav.active .nav-action {
    animation: scope0 .3s forwards;
    -webkit-animation: scope0 .3s forwards; /* Safari 和 Chrome */
  }

  .pack-nav.unactive .nav-action {
    animation: scope1 .25s ease-out forwards;
    -webkit-animation: scope1 .25s ease-out forwards; /* Safari 和 Chrome */
  }

  .pack-nav {
    position: fixed;
    bottom: 65px;
    height: 65px;
    right: 35px;
  }

  .nav-icon {
    position: absolute;
    right: 0;
    top: 0;
    z-index: 100;
    width: 64px;
    height: 64px;
    border-radius: 32px;
    background-color: #DF3031;
  }

  .nav-action {
    position: absolute;
    right: 0;
    top: 0;
    z-index: 99;
    width: 64px;
    height: 64px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 32px;
    overflow: hidden;
    -webkit-transition: all .3s;
    transition: all .3s;
    /*     -moz-transition: all 1s;
       -ms-transition: all 1s;
       -o-transition: all 1s;    */

  }

  .action-item {
    padding-left: 34px;
    position: absolute;
    top: 0px;
    left: 0px;
    height: 100%;
    width: 64px;
  }

  .action-mypub {
    left: 64px
  }

  .icon-publish {
    width: 23px;
    height: 20px;
    background: url('../img/publish2.png') no-repeat;
    background-size: cover;
    float: left;
    position: relative;
    top: 13px
  }

  .icon-my-pub {
    background: url('../img/mypublish2.png') no-repeat;
    background-size: cover;
    margin-left: -15px;
    width: 20px;
    height: 17px;
    top: 15px;
  }

  .comment-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FF3B30;
    right: -4px;
    top: -4px;
  }

  .action-text {
    top: 38px;
    left: 30px;
    position: absolute;
  }

  .action-text-mypub {
    top: 38px;
    left: 17px;
    position: absolute;
  }

  .icon-title {
    font-size: 13px;
    color: #fff;
    letter-spacing: 0;
  }

  /* 瀑布流 */
  .waterfalls {
    position: relative;
    width: 100%;
  }

  /* 图片容器 */
  .photo-container {
    position: absolute;
    width: 186px;
    opacity: 0;
    -webkit-transform: scale(0.9);
    transform: scale(0.9);
  }

  .photo-container.load {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
    transition: opacity .35s;
    -webkit-transition: opacity .35s;
    /*animation:showBox .25s .2s forwards;*/
    /*-webkit-animation:showBox .25s .2s forwards;*/
  }

  @keyframes showBox {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
      -webkit-transform: scale(1);
      transform: scale(1);
    }
  }

  @-webkit-keyframes showBox {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
      -webkit-transform: scale(1);
      transform: scale(1);
    }
  }

  /* 随手拍的logo */
  .logo-box {
    position: absolute;
    width: 167px;
    height: 70px;
    right: 15px;
    top: 0;
    background: url('../img/plogo.png') no-repeat center;
    background-size: cover;
  }

  .convphoto-title {
    margin-top: 14px;
    text-align: center;
    font-family: STHeitiSC-Medium;
    font-size: 17px;
    color: #FFFFFF;
    letter-spacing: -0.53px;
  }

  .convphoto-subtitle {
    font-family: STHeitiSC-Light;
    font-size: 15px;
    color: #FFFFFF;
    letter-spacing: -0.47px;
    line-height: 18px;
    margin-top: 5px;
    text-align: center;
  }

  .line {
    display: inline-block;
    width: 16px;
    height: 1px;
    opacity: 0.56;
    background: #FFFFFF;
    vertical-align: middle;
    margin: 0 3px;
  }

  .img-box {
    line-height: 0; // min-height: 100px;
    position: relative;
  }

  .img-box img {
    background: #fdfdfd;
  }

  .img-num-box {
    position: absolute;
    background: rgba(0, 0, 0, 0.40);
    border-radius: 2px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 14px;
    color: #FFFFFF;
    bottom: 10px;
    right: 10px;
  }

  .subinfo-box {

    font-size: 15px;
    color: #000000;
    line-height: 18px; // margin: 8px 0 14px 0;
    overflow: hidden;
    padding-bottom: 20px;
    background: #fff;
  }

  .title {
    font-size: 15px;
    color: #000000;
    line-height: 23px;
    margin-top: 5px;
    padding: 0 10px;
  }

  .act-box {
    line-height: 17px;
    margin-top: 7px;
    padding: 0 10px;
    overflow: hidden;
  }

  .vote-box {
    float: left;
    width: 84px;
  }

  .vote-box .vote-icon {
    background: url('../img/novote.png') no-repeat center;
    background-size: cover;
    display: inline-block;
    width: 17px;
    height: 17px;
    vertical-align: middle;
    margin-top: -3px;
  }

  .vote-box.active .vote-icon {
    background: url('../img/vote.png') no-repeat center;
    background-size: cover;
  }

  .vote-box .vote-num {
    font-size: 14px;
    color: #868686; // margin-left: 5px;
    vertical-align: middle;
  }

  .vote-box.active .vote-num {
    color: #DF3031;
  }

  .discuzz-box {
    float: left;
  }

  .discuzz {
    background: url('../img/discuzz.png') no-repeat center;
    background-size: cover;
    display: inline-block;
    width: 17px;
    height: 17px;
    vertical-align: middle; // margin-right: 5px;
  }

  .discuzz-num {
    font-size: 14px;
    color: #868686;
    vertical-align: middle;
  }
</style>
